<template>
    <el-form
     ref="dataList"
     :model="forms"
     label-width="120px"
     label-position="top"
   >
     <el-row>
       <el-col>
         <el-table :data="forms.areaList" border class="borderTable">
           <el-table-column
             label="序号"
             align="center"
             type="index"
             width="55"
           />
           <el-table-column
             label="省"
             align="center"
             prop="taskName"
           >
             <template #default="scope">
               <span>{{ scope.row.province }}</span>
             </template>
           </el-table-column>
           <el-table-column
             label="预评估任务名称"
             align="center"
             prop="taskName"
           >
             <template #default="scope">
               <span>{{ scope.row.ypgTaskNames }}</span>
             </template>
           </el-table-column>
           <el-table-column label="总得分" align="center" prop="totalScore" sortable>
             <template #default="scope">
               {{ scope.row.totalScore }}
             </template>
           </el-table-column>
           <el-table-column label="最终得分" align="center" prop="lastScore" sortable>
             <template #default="scope">
               {{ scope.row.lastScore }}
             </template>
           </el-table-column>
           <el-table-column
             label="得分详情"
             align="center"
             prop=""
           >
             <template #default="scope">
               <el-button plain @click="handleView(scope.row)">查看</el-button>
             </template>
           </el-table-column>
         </el-table>
       </el-col>
     </el-row>
   </el-form>
</template>
<script setup>
import {
  getGlTaskScoreDetails,
} from "@/api/workEvaluation/appraisalTaskManagement/appraisalTaskManage.js";
import { useRouter } from 'vue-router';
const { proxy } = getCurrentInstance();
const router = useRouter();
const props=defineProps({
   forms:{
       default: {},
       type: Object,
   },
   activeData:{
    default:0,
    type:Number
   },
   krtId: {
    default: "",
    type: String,
  },
})
const { forms,krtId, activeData} = toRefs(props)

const handleView=(val)=>{
  if(activeData.value==3){
    router.push({
      path: "/workEvaluation/appraisalTaskManagement/detailIndex",
      // state:{
      //   active:3,
      //   data:JSON.stringify(obj)
      // },
      query:{
        active:3,
        provinceId: val.provinceId,
       krtId: krtId.value,
      }
    });
  }
  else{
    router.push({
      path: "/workEvaluation/appraisalTaskManagement/detailIndex",
      // state:{
      //   active:3,
      //   data:JSON.stringify(obj)
      // },
      query:{
        active:4,
        provinceId: val.provinceId,
       krtId: krtId.value,
      }
    });
  }
  // let obj={}
  // getGlTaskScoreDetails({
  //   provinceId: val.provinceId,
  //   krtId: krtId.value,
  // }).then((res) => {
  //   obj = res.data;
  //   router.push({
  //     path: "/workEvaluation/appraisalTaskManagement/detailIndex",
  //     state:{
  //       active:3,
  //       data:JSON.stringify(obj)
  //     },
  //   });
  // });
}
</script>
<style lang="scss" scoped></style>